<template>
	<el-container>
		<el-main>
			<el-form  ref="item" :model="item" label-width="150px" style="margin-top: 1%;">
				 
			    <el-form-item label="订单号" >
                    <el-col :span="10">
					    <el-input v-model="item.orderNo"></el-input>
                    </el-col>
				</el-form-item>   
			    <el-form-item label="商品ID" >
                    <el-col :span="10">
					    <el-input v-model="item.goodId"></el-input>
                    </el-col>
				</el-form-item>   
			    <el-form-item label="商品名" >
                    <el-col :span="10">
					    <el-input v-model="item.goodName"></el-input>
                    </el-col>
				</el-form-item>   
			    <el-form-item label="商品单价" >
                    <el-col :span="10">
					    <el-input v-model="item.price"></el-input>
                    </el-col>
				</el-form-item>   
			    <el-form-item label="商品数量" >
                    <el-col :span="10">
					    <el-input v-model="item.goodNum"></el-input>
                    </el-col>
				</el-form-item>   
			    <el-form-item label="商品总数" >
                    <el-col :span="10">
					    <el-input v-model="item.totalNum"></el-input>
                    </el-col>
				</el-form-item>   
			    <el-form-item label="商品总价" >
                    <el-col :span="10">
					    <el-input v-model="item.totalPrice"></el-input>
                    </el-col>
				</el-form-item>     
			    <el-form-item label="商品图片" >
                    <el-col :span="10">
					    <el-input v-model="item.goodPic"></el-input>
                    </el-col>
				</el-form-item>   				<el-form-item>
					<el-button type="primary" @click="onSubmit">保存</el-button>
					
				</el-form-item>
			</el-form>
		</el-main>
	</el-container>
</template>

<script>
	import {post} from "@/api/user";
	export default {
		name: "mallOrderLogedit",
		data(){
			return {
				item:{
				},
				id:-1,
			}
		},
		methods:{
			getItemById(){
				let _this = this
				post('/mall/mallOrderLog/getById',{
					id:_this.id
				}).then(res =>{
					_this.item =  res.i
				}).catch(err =>{

				})
			},
			onSubmit(){
				this.save()
			},
			save(){
				let _this = this
				post('/mall/mallOrderLog/save',_this.item).then(res =>{
					_this.$router.push({path:'/mallOrderLog/list'})
				}).catch(err =>{

				})
			}
		},
		created(){
			this.id =   this.$route.query.id
			this.getItemById()
		}
	}
</script>

<style scoped>
    .el-form-item{
        width: 80%;
    }
</style>
